<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>es6新特性...运算符 - 对象拷贝</title>
</head>
<body>


</body>

<script>

    //   深拷贝
    //   let obj1={name:'Jacl'} ;
    //   let obj2=obj1 ;
    //   obj1["age"]=12 ;
    //   console.log(obj2);    //{name: "Jacl", age: 12}


    //   浅拷贝
    let obj1 = {name: 'Jacl'}   ;
    let obj2 = {...obj1}        ;
    obj1["age"] = 12            ;
    console.log(obj2);  //{name: "Jacl"}


</script>


</html>
